<?php
/*
 * @author HX<titanrain@163.com>
 */
class AdminController extends Controller{
	
	public function filterAccessAuth($filterChain) {  
		$userId = User::id();
		if(!in_array($userId,Yii::app()->params['adminIds'])){
			$this->redirect(Yii::app()->params['siteHome']); 
		}
		$filterChain->run();	
	}	
	
	public function filters() {  
        return array(  
            'accessAuth',  
        );  
    }
      
    public function authlessActions() {  
        return array();  
    } 
    
	public function actionNotCheckedBooks($pageno = 1){
		$page = BookService::notCheckedBooks($pageno);
		//$this->render('feedback/index.tpl',array('page'=>$page));
	}
	
	public function actionIndex(){
		/*
        $userCount = UserService::allUserCount();
        $bookStatistics = BookService::statistics();
        $data = array(
            'user_count'=>$userCount,
            'book_statistics'=>$bookStatistics,
            );
            */
        $data = array(
        'user_count'=>0,
        'book_statistics'=>0,
        );
		$this->render('admin/index.tpl',$data);
	}

    public function actionAllBooksUI(){
        $this->render('admin/books.tpl');
    }
}
